//
//  FPTodayHotTableViewCell.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/14.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPTodayHotTableViewCell.h"

@implementation FPTodayHotTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.hotImage = [[UIImageView alloc]initWithFrame:CGRectMake(kImageW( 10), kImageH(5), kImageW(100), kImageH(70))];
        self.hotImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_hotImage];
        
        self.titlelbl = [[UILabel alloc]initWithFrame:CGRectMake(kImageW(20) + _hotImage.width , _hotImage.y, kImageW(240), kImageH(25))];
//        _titlelbl.backgroundColor = [UIColor redColor];
        self.titlelbl.numberOfLines = 0;
        [self.contentView addSubview:_titlelbl];
        
        self.messlbl = [[UILabel alloc]initWithFrame:CGRectZero];
        self.messlbl.textColor = [UIColor grayColor];
        self.messlbl.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_messlbl];
        
        self.timelbl = [[UILabel alloc]initWithFrame:CGRectZero];
        self.timelbl.textColor = [UIColor grayColor];
        self.timelbl.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_timelbl];
        
        
    }
    return self;
}

- (void)cellForHeight:(NSString *)str
{
    self.titlelbl.text = str;
    CGRect bounds = [str boundingRectWithSize:CGSizeMake(kImageW(240), 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:15] forKey:NSFontAttributeName] context:nil];
    self.titlelbl.font = [UIFont systemFontOfSize:15];
    self.titlelbl.height = bounds.size.height;
    self.messlbl.frame = CGRectMake(_titlelbl.x, _titlelbl.y + _titlelbl.height, kImageW(200), kImageH(20));
    self.timelbl.frame = CGRectMake(_titlelbl.x, _messlbl.y + _messlbl.height, kImageW(200), kImageH(20));
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
